package com.example.myapplication;

import android.opengl.EGLSurface;

import android.opengl.GLSurfaceView;

import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import android.util.Log;

public class MainActivity extends AppCompatActivity {

    private GLSurfaceView mGLSurfaceView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Log.i("Activity", "onCreate");

        // 实例化GLSurfaceView (EGL处理opengles 与窗口系统）
        mGLSurfaceView = new GLSurfaceView(this);

        // 设置渲染器
        mGLSurfaceView.setRenderer(new GLRender(this));

        setContentView(mGLSurfaceView);

//        Button btn1 = (Button)findViewById(R.id.btn1);
//        TextView tv = (TextView)findViewById(R.id.textView);
//        btn1.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                Log.i("Button", "onClicked");
//                tv.setText(R.string.tv_text);
//            }
//        });
    }

    @Override
    protected void onResume()
    {
        super.onResume();
        mGLSurfaceView.onResume();
    }

    @Override
    protected void onPause()
    {
        super.onPause();
        mGLSurfaceView.onPause();
    }
}




























